feat(events): differentiate draft-incomplete vs draft-complete UI for presentations#991
feat(events): differentiate draft-incomplete vs draft-complete UI for presentations#991romanetar wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthrough
ChangesEventForm Draft-Complete State Refactor
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/components/forms/event-form.js`:
- Around line 750-753: The isDraftComplete() method uses hardcoded string
literals "NonReceived" and "COMPLETE" instead of constants, which can lead to
typos and maintenance issues. Create two new constant definitions in
src/utils/constants.js: one for EVENT_STATUS (with a NON_RECEIVED property) and
one for EVENT_PROGRESS (with a COMPLETE property). Then import these constants
at the top of the event-form.js file and replace the hardcoded strings in the
isDraftComplete() method with references to EVENT_STATUS.NON_RECEIVED and
EVENT_PROGRESS.COMPLETE respectively.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 16b79371-9d2c-439a-a90b-f09256738f7f
📒 Files selected for processing (1)
src/components/forms/event-form.js
| isDraftComplete() { | ||
| const { entity } = this.state; | ||
| return entity?.status === "NonReceived" && entity?.progress === "COMPLETE"; | ||
| } |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Verify event progress constant usage
# Search for event progress constant definitions
rg -n --type=js -C3 'progress.*=.*["\']COMPLETE["\']'
# Search for progress field usage in event context
rg -n --type=js -A3 -B3 'entity\.progress|event\.progress' src/pages/events/
# Check if there's an event-specific progress constant
ast-grep --pattern 'export const $EVENT_PROGRESS = {
$$$
}'Repository: fntechgit/summit-admin
Length of output: 135
🏁 Script executed:
#!/bin/bash
# Search for COMPLETE constant definitions
rg -n "COMPLETE" src/utils/constants.js src/utils/
# Search for NonReceived constant or usage
rg -n "NonReceived" --type=js -B2 -A2
# Check where progress field is set in event form
rg -n "progress" src/components/forms/event-form.js -B1 -A1 | head -50
# Look for event progress related constants
rg -n "progress|COMPLETE" src/utils/constants.jsRepository: fntechgit/summit-admin
Length of output: 1149
🏁 Script executed:
#!/bin/bash
# Check imports at top of event-form.js
head -50 src/components/forms/event-form.js | grep -n "import"
# Get full context of COMPLETE constant definition
rg -n -B5 -A5 "COMPLETE: \"COMPLETE\"" src/utils/constants.js
# Search for NonReceived constant definition
rg -n "NonReceived" src/utils/constants.js
# Check what COMPLETE constant belongs to (which export)
rg -n -B20 "COMPLETE: \"COMPLETE\"" src/utils/constants.js | head -40Repository: fntechgit/summit-admin
Length of output: 2947
🏁 Script executed:
#!/bin/bash
# Search for all COMPLETE definitions across the codebase
rg -n "COMPLETE.*:" src/utils/constants.js
# Check for any event progress related constants
rg -n "PROGRESS|EVENT" src/utils/constants.js | head -20
# Search for where entity.progress is assigned or used
rg -n "\.progress\s*=" src/components/forms/event-form.js
# Check if COMPLETE is imported anywhere in event-form.js
rg -n "COMPLETE" src/components/forms/event-form.jsRepository: fntechgit/summit-admin
Length of output: 519
Define constants for event progress and status values rather than using string literals.
The isDraftComplete() method uses string literals "NonReceived" and "COMPLETE" directly. While the COMPLETE constant exists in src/utils/constants.js, it's defined for SPONSOR_MEDIA_UPLOAD_STATUS (line 304), not event progress. Similarly, NonReceived has no corresponding constant definition.
The code appears to use "COMPLETE" as a generic progress value, but this lacks proper constant definitions. Consider creating dedicated constants for event progress (e.g., EVENT_PROGRESS) and event status values (e.g., EVENT_STATUS) in src/utils/constants.js to improve maintainability and prevent typos.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/components/forms/event-form.js` around lines 750 - 753, The
isDraftComplete() method uses hardcoded string literals "NonReceived" and
"COMPLETE" instead of constants, which can lead to typos and maintenance issues.
Create two new constant definitions in src/utils/constants.js: one for
EVENT_STATUS (with a NON_RECEIVED property) and one for EVENT_PROGRESS (with a
COMPLETE property). Then import these constants at the top of the event-form.js
file and replace the hardcoded strings in the isDraftComplete() method with
references to EVENT_STATUS.NON_RECEIVED and EVENT_PROGRESS.COMPLETE
respectively.
ref https://app.clickup.com/t/86ba3xg57
Summary by CodeRabbit